
const path = require("path")
const webpack = require("webpack")
const common = require("./webpack.common")
const { merge } = require("webpack-merge")

module.exports = merge(common, {
    mode: "development",
    devtool: "cheap-eval-module-source-map",
    devServer: {
        hotOnly: true,
        contentBase: "public",
        overlay: {
            warnings: true,
            errors: true,
        },
        port: 9999,
        proxy: {
            "/api": {
                target: "https://api.github.com/users",
                pathRewrite: {
                    "^/api": ""
                },
                changeOrigin: true
            }
        }
    },
    plugins: [
        new webpack.HotModuleReplacementPlugin()
    ]
})